LGF_Frequency (FB / 3.0.1)

Overview

Author: Siemens Industry Support

Short description

This function generates a signal that changes between the values FALSE and TRUE depending on a defined frequency and a pulse pause ratio.

Block Interface

LGF_Frequency (FB)
Real  frequency clock  Bool
    
Real  pulsePauseRatio countdown  Time
    
   

Input parameter

IdentifierData type Default value Description
frequencyReal 0.0 Clock frequency in Hz.
pulsePauseRatioReal 1.0 Pulse pause ratio (standard: 1.0 corresponds to 1:1).

Output parameter

IdentifierData type Description
clockBool Output changes with defined frequency.
countdownTime Remaining time of the current `clock` state.

Functional description

The clock output is a Boolean value that toggles at the desired frequency. The pulsePauseRatio input is used to set the pulse pause ratio.

The output countdown outputs the remaining time of the current state of clock.

If the desired frequency or pulse pause ratio is less than or equal to 0.0, the output clock = FALSE and countdown = 0s.


Example

LGF_Frequency


Note
The clock of the FB LGF_Frequency depends on the cycle time of the OB Main. To increase the accuracy, the FB can also be called in a cyclic interrupt OB with a low time interval.

Change log

Version & DateChange description
1.0.0Siemens Industry Online Support
19.08.2015First released version
1.1.0Siemens Industry Online Support
25.05.2016New function: pulse pause ratio
1.1.1Siemens Industry Online Support
26.05.2016Add comments
1.1.2Siemens Industry Online Support
02.01.2017Upgrade: TIA Portal V14 Update 1
1.1.3Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
1.1.4Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
1.0.7Simatic Systems Support
20.09.2019Code refactoring, regions and more comments added
3.0.0Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
3.0.1Simatic Systems Support
15.02.2021Insert documentation